import React from 'react';


import { Dialog } from '../../../components/dialog/dialog';

interface IProps {
  onCancel: () => void;
  show: boolean;
  formValue: { key: string, text: string, time: string };
  onChangeInput: (e: any) => void;
  onConfirm: () => void;
}

const EditModal: React.FC<IProps> = (props) => {
  const { onCancel, onConfirm, show = false, formValue, onChangeInput } = props;

  const handleCancel = () => {
    onCancel();
  }

  return (
    <Dialog
      show={show}
      title={'添加待办'}
      onCancel={handleCancel}
    >
      <div>
        <input style={{marginBottom: '16px'}} type="text" value={formValue.text} onChange={onChangeInput} />

        <button
          style={{marginRight: '12px'}}
          onClick={onConfirm}
        >确定</button>
        <button onClick={handleCancel}>取消</button>
      </div>
    </Dialog>
  )
}

export default EditModal;
